<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <style type="text/css">
        #result{
        border: 10px;
        font-size: 50px;
        background: #ff0fef;
        }
    </style>
</head>
<body>
<input type="text" name="ip" id="ip">
<br>
<input type="submit" name="sub" id="sub" value="Post">
<br>
<div id="result"></div>
<script type="text/javascript">
    $("#sub").click(function () {
        var ip = $("#ip").val();
        var message = {"ip":ip, "status": true}
        $.ajax({
            url: '/perip',
            method: "POST",
            data: JSON.stringify(message),
//            headers: {
//                "X-XSRFTOKEN": getCookie("_xsrf"),
//            },
            contentType: "application/json",
            dataType: "json",
            success: function (message) {
                alert(data)
            },
            error: function () {
                alert("Ajax error")
            }
        });
    });
</script>
</body>
</html>